<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInventoryAuditHistory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('inventory_audit_history')) {
            Schema::create('inventory_audit_history', function (Blueprint $table) {
                $table->id();
                $table->unsignedInteger('inventory_allot_id')->default(0);
                $table->unsignedInteger('quantity')->default(0);
                $table->string('description')->default('');
                $table->unsignedInteger('create_user_id')->default(0);
                $table->integer('create_time')->nullable();
                $table->integer('update_time')->nullable();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('inventory_audit_history');
    }
}
